package middle

import (
	"github.com/gin-gonic/gin"
	"leetcode/ddaa/cntrll"
)

func IsloginMiddle(c *gin.Context) {

	tk := c.Query("token")

	if tk == "" || tk != cntrll.T {
		c.Abort()
		c.JSON(500, "请先登录！")
	} else {
		c.Next()
	}

}
